package cn.bdqn.tangcc.user.dao.impl;

import cn.bdqn.tangcc.base.dao.impl.BaseDaoImpl;
import cn.bdqn.tangcc.entity.Tbuser;
import cn.bdqn.tangcc.user.dao.UserDao;
import org.springframework.stereotype.Repository;

/**
 * Created by Administrator on 2016/5/29.
 */
@Repository
public class UserDaoImpl extends BaseDaoImpl implements UserDao {
    @Override
    public Tbuser login(Tbuser users) {
        return (Tbuser) this.getSession()
                .createQuery("from Tbuser  users where users.username=:username and users.password=:password")
                .setParameter("username",users.getUsername())
                .setParameter("password",users.getPassword())
                .uniqueResult();
    }
}
